﻿using System.ComponentModel;

namespace CthulhuDomain.GameEntities
{
  public abstract class DomainFactory
  {
    public enum eTypeEntity
    {
      None = 0,
      Cthulhu = 1,
      Player = 2,
      Shoot = 3,
      Bang = 4
    }

    public static DomainFactory GetFactory(eTypeEntity type)
    {
      DomainFactory factory;
      switch (type)
      {
        case eTypeEntity.Cthulhu:
          factory = new CthulhuFactory();
          break;
        case eTypeEntity.Player:
          factory = new PlayerFactory();
          break;
        case eTypeEntity.Shoot:
          factory = new ShootFactory();
          break;
        case eTypeEntity.Bang:
          factory = new BangFactory();
          break;
        default:
          throw new InvalidEnumArgumentException();
      }
      return factory;
    }

    public abstract DomainEntity CreateEntity(IContentManager manager);
    public abstract DomainEntity CreateEntity(IContentManager manager, EntityState state);
  }
}
